add_compile_options(--expt-extended-lambda --expt-relaxed-constexpr)
# spmm_test
add_executable(spmm_test kernel_test.cu)
target_compile_options(spmm_test PRIVATE ${OpenMP_CUDA_FLAGS} -keep -fopenmp)
target_link_libraries(spmm_test PUBLIC OpenMP::OpenMP_CXX cusparse)
set_target_properties(spmm_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)

add_library(sddmm_test_obj OBJECT kernel_sddmm.cu)
add_executable(sddmm_test)
target_compile_options(sddmm_test_obj PRIVATE ${OpenMP_CUDA_FLAGS} -keep -fopenmp)
target_link_libraries(sddmm_test_obj PUBLIC OpenMP::OpenMP_CXX cusparse)
target_link_libraries(sddmm_test PRIVATE sddmm_test_obj)
set_target_properties(sddmm_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)

# add_library(spmm_test_ptx OBJECT demo_kernels/kernel_test.cu)
# set_property(TARGET spmm_test_ptx PROPERTY CUDA_PTX_COMPILATION On)
# target_compile_features(spmm_test_ptx PRIVATE cxx_std_14)
# target_compile_options(spmm_test_ptx PRIVATE ${OpenMP_CUDA_FLAGS} ${gswitch_NVCC_FLAGS})
# target_include_directories(spmm_test_ptx PRIVATE cuda ${Python_INCLUDE_DIRS} ${TORCH_INCLUDE_DIRS})
# target_link_libraries(spmm_test_ptx PUBLIC OpenMP::OpenMP_CXX cusparse ${TORCH_LIBRARIES} gswitch)

add_library(dgsparse SHARED IMPORTED)
set(dgSPARSE_ROOT ${PROJECT_SOURCE_DIR}/../dgSPARSE-Library/)
set_target_properties(dgsparse PROPERTIES IMPORTED_LOCATION 
                      ${dgSPARSE_ROOT}/lib/dgsparse.so )

add_library(mat_benchmark_obj OBJECT mat_benchmark.cu)
add_executable(mat_benchmark)
target_compile_options(mat_benchmark_obj PRIVATE ${OpenMP_CUDA_FLAGS} -keep -fopenmp)
target_link_libraries(mat_benchmark_obj PUBLIC OpenMP::OpenMP_CXX cusparse cublasLt)
target_link_libraries(mat_benchmark PRIVATE mat_benchmark_obj )
set_target_properties(mat_benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)